import React, { Component } from "react";

class Child extends Component {
  render() {
    // console.log(this.props);
    return (
      <div>
        {this.props.children.icon} - child组件 - {this.props.children.text}
      </div>
    );
  }
}

class App extends Component {
  render() {
    return (
      <>
        <h2>具名插槽</h2>
        <Child>
          {/* <span>123</span>
          <span>456</span> */}
          {{
            icon: <span>123</span>,
            text: <span>456</span>,
          }}
        </Child>
      </>
    );
  }
}

export default App;
